package com.draven.model;

import java.util.Date;

/**
 *
 * 分页工具类
 * Created by Draven on 2017/4/18.
 * E-mail:draven1122@163.com
 */
public class BaseConditionVO {
    private int totalCount = 0;
    private int page = 1;
    private int rows = 20;
    private int totalPages = 1;
    private int startIndex;
    private String order;
    private String sort;
    private String keywords;
    private Date startDate;
    private Date endDate;

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalPages = totalPages = totalCount / rows +(totalCount % rows == 0?0:1);
        this.totalCount = totalCount;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    public int getStartIndex() {
        return (page - 1) * rows;
    }

    public void setStartIndex(int startIndex) {
        this.startIndex = startIndex;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }
    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }
}
